<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends Controller {

	function Admin()
	{
		parent::Controller();
		$this->load->library('auth');
		$this->load->library('fungsi');
		$this->load->model(array('setting_m', 'area_m','Admin_Model'));
		$this->load->model('app_login_auth');
	}	
	
	var $limit = 10;
	
	function index()
	{
		$this->data['graph'] = $this->creategraph();
		//Mengambil 10 data koleksi terbaru yang di upload
			$this->data['newUpload'] = $this->setting_m->getNewUpload('');
			//content body
			$this->data['content'] = 'admin/home_v';
			$this->data['left'] = 'bg_left';
			$this->data['footer'] = 'footer';
			$this->data['tableNewRegist'] = $this->genTableTopTenRegist();
			$this->data['tableUploadPublish'] = $this->getTableTopTenPublish();
			$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
			
			//Memanggil View
			$this->load->view('home/index', $this->data);
		
	}
	function genTableTopTenRegist()
	{
		$adminRegist = $this->Admin_Model->get_last_ten_Register();	
		$dtTable = '';
		foreach ($adminRegist as $newRegist)
		{
			// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
			$dtTable .= '<tr>
							<td headers="t1" class="standard">'.$newRegist->USERNAME.'</td>
							<td headers="t2" class="standard">'.$newRegist->ID.'</td>
							<td headers="t3" class="standard">'.$newRegist->NAMA.'</td>
							<td headers="t4" class="standard">'.$newRegist->AKSES.'</td>
							<td class="standard" align="center">';
			$dtTable .= anchor("admin/appvUser/".$newRegist->KD_USER,$newRegist->AKTIF,array("class" => "aktif","onclick"=>"return confirm('Anda yakin akan approve user ini?')"));
			$dtTable .= '</td></tr>';
		}
		
		return $dtTable;
	}
	function getTableTopTenPublish()
	{
		$getTenPublish = $this->Admin_Model->get_ten_wait_publish();
		$dtTable = '';
		foreach ($getTenPublish as $getToPublish)
		{
			// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
			// $this->table->add_row(++$i, $getToPublish->TITLE, $getToPublish->NAMA, 
									// anchor('admin/appvAdvisor/'.$getToPublish->ID_COLLECTION,$getToPublish->Approve,array('class' => 'update',
																									// 'onclick'=>"return confirm('Anda yakin akan approve data ini?')")),anchor('admin/Publish/'.$getToPublish->ID_COLLECTION,$getToPublish->Publish,array('class' => 'update',
																									// 'onclick'=>"return confirm('Anda yakin akan approve data ini?')"))
								// );
			$dtTable .= '<tr>
							<td headers="t1" class="standard">'.$getToPublish->TITLE.'</td>
							<td headers="t2" class="standard">'.$getToPublish->NAMA.'</td>
							<td headers="t3" class="standard">';//.$getToPublish->NAMA.'</td>
			$dtTable .= anchor('admin/appvAdvisor/'.$getToPublish->ID_COLLECTION,$getToPublish->Approve,array('class' => 'update','onclick'=>"return confirm('Anda yakin akan approve data ini?')"));
			$dtTable .=	'</td><td headers="t4" class="standard">';
			$dtTable .= anchor('admin/Publish/'.$getToPublish->ID_COLLECTION,$getToPublish->Publish,array('class' => 'update','onclick'=>"return confirm('Anda yakin akan approve data ini?')"));
			$dtTable .= '</td></tr>';
		}
	
		return $dtTable;
	}
	
	function MasterMhs($offset = 0)
	{
		$this->data['content'] = 'admin/masterMhs';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		$this->data['ddlThnAjrn'] = $this->setting_m->getCboThnAjrn();
		$this->data['ddlProdi'] = $this->setting_m->getCboJurusan();
		$this->data['ddlGelar'] = $this->setting_m->getCboGelar();
		$this->data['ddlDosen'] = $this->setting_m->getCboDosen();
		//setting form action
		$this->data['form_action'] = site_url('admin/savingMhs');
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		$this->table->clear();
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$mhs = $this->Admin_Model->get_ten_mhs($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_mhs();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			// Penomoran baris data
			$i = 0 + $offset;
			$dtTable = '';
			foreach ($mhs as $mahasiswa)
			{
				// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$mahasiswa->NIM.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$mahasiswa->NAMA_MAHASISWA.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateMhs/'.$mahasiswa->NIM,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delMhs/'.$mahasiswa->NIM,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')</td>"));
				$dtTable .= '<td headers="t4" class="standard">';
				$check = $this->Admin_Model->allowDownload($mahasiswa->NIM);
				if ($check->num_rows() > 0){
					foreach ($check->result() as $chk)
					{
						$test = $chk->ALLOW;
						if ($chk->ALLOW == '1'){
							$dtTable .= anchor('admin/notallow/'.$mahasiswa->NIM,'Not Allow',array('class' => 'update'));
						}
						else{
							$dtTable .= anchor('admin/allow/'.$mahasiswa->NIM,'Allow',array('class' => 'update'));
						}
					}}
				else{
					$dtTable .= anchor('admin/allow/'.$mahasiswa->NIM,'Allow',array('class' => 'update'));
				}
				$dtTable.='</td></tr>';
			}
			$this->data['tableMhs'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function allow($nim)
	{
		try{
			$this->Admin_Model->do_allow($nim);
			redirect('admin/MasterMhs');
		}
		catch (Exception $e){
			
		}
	}
	
	function notallow($nim)
	{
		try{
			$this->Admin_Model->do_notallow($nim);
			redirect('admin/MasterMhs');
		}
		catch (Exception $e){
			
		}
	}
	
	function savingMhs()
	{
		$this->load->library('form_validation');
		
		$nim  = $this->input->post('txtNim', TRUE);
        $nama = $this->input->post('txtNamaMhs', TRUE);
		$tglLhr = $this->input->post('dtTglLahir', TRUE);
		$alamat = $this->input->post('txtAlamat', TRUE);
		$jk = $this->input->post('ddlJk', TRUE);
		$thnAjrn = $this->input->post('ddlThnAjrn', TRUE);
		$prodi = $this->input->post('ddlProdi', TRUE);
		$gelar = $this->input->post('ddlGelar', TRUE);
		$nip = $this->input->post('ddlDosenWali', TRUE);
		
		$this->form_validation->set_rules('txtNim', 'Nim', 'required');
		$this->form_validation->set_rules('txtNamaMhs', 'Nama', 'required');
		$this->form_validation->set_rules('dtTglLahir', 'Tanggal Lahir', 'required');
		$this->form_validation->set_rules('txtAlamat', 'Alamat', 'required');
		
		$this->data['ddlThnAjrn'] = $this->setting_m->getCboThnAjrn();
		$this->data['ddlProdi'] = $this->setting_m->getCboJurusan();
		$this->data['ddlGelar'] = $this->setting_m->getCboGelar();
		$this->data['ddlDosen'] = $this->setting_m->getCboDosen();
		$this->data['content'] = 'admin/MasterMhs';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingMhs');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$mhs = $this->Admin_Model->get_ten_mhs($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_mhs();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			
			// Set template tabel, untuk efek selang-seling tiap baris
			$tmpl = array( 'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
						  'row_alt_start'  => '<tr class="zebra">',
							'row_alt_end'    => '</tr>'
						  );
			$this->table->set_template($tmpl);

			// Set heading untuk tabel
			$this->table->set_empty("&nbsp;");
			$this->table->set_heading('No','Nim', 'Nama', 'Tgl. Lahir', 'Alamat','Actions');
			
			// Penomoran baris data
			$i = 0 + $offset;
			
			foreach ($mhs as $mahasiswa)
			{
				// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
				$this->table->add_row(++$i, $mahasiswa->NIM, $mahasiswa->NAMA, $mahasiswa->TGLLAHIR, $mahasiswa->ALAMAT,
										anchor('admin/updateMhs/'.$mahasiswa->NIM,'update',array('class' => 'update')).' '.
										anchor('admin/delMhs/'.$mahasiswa->NIM,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"))
									);
			}
			$this->data['tableMhs'] = $this->table->generate();
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				$result = $this->Admin_Model->doSavingMahasiswa($nim, $nama, $tglLhr, $alamat,$jk, $thnAjrn, $prodi,$gelar,$nip );
				$this->data['error'] = 'Berhasil disimpan';
				redirect('admin/MasterMhs');
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterMhs');
			
		}
		
	}
	
	function updateMhs($nim)
	{
		$this->data['content'] = 'admin/masterMhs';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/doUpdateMhs');
		$this->data['ddlThnAjrn'] = $this->setting_m->getCboThnAjrn();
		$this->data['ddlProdi'] = $this->setting_m->getCboJurusan();
		$this->data['ddlGelar'] = $this->setting_m->getCboGelar();
		$this->data['ddlDosen'] = $this->setting_m->getCboDosen();
		//setting readonly pada field kd Mahasiswa
		$this->data['readonly'] = 'readonly = "true"';
		$this->data['error'] = '';
		//get data Mahasiswa from database
		$mhs = $this->Admin_Model->get_mhs_nim($nim)->row();
		$this->data['default']['NIM'] = $mhs->nim;
		$this->data['default']['NamaMhs'] = $mhs->nama_mahasiswa;
		$this->data['default']['TglLhr'] = $mhs->tgllahir;
		$this->data['default']['Almt'] = $mhs->alamat;
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$mhs = $this->Admin_Model->get_ten_mhs($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_mhs();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			
			// Penomoran baris data
			$i = 0 + $offset;
			$dtTable = '';
			foreach ($mhs as $mahasiswa)
			{
				// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t1" class="standard">'.$mahasiswa->NIM.'</td>';
				$dtTable .= '<td headers="t2" class="standard">'.$mahasiswa->NAMA_MAHASISWA.'</td>
							<td headers="t3" class="standard" align="center">';
				$dtTable .= anchor('admin/updateMhs/'.$mahasiswa->NIM,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delMhs/'.$mahasiswa->NIM,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')</td>"));
				$dtTable .= '<td headers="t4" class="standard">';
				$dtTable .= anchor('admin/updateMhs/'.$mahasiswa->NIM,'Allow',array('class' => 'update'));
				$dtTable.='</td></tr>';
			}
			$this->data['tableMhs'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function doUpdateMhs()
	{
		$this->load->library('form_validation');
		
		$nim  = $this->input->post('txtNim', TRUE);
        $nama = $this->input->post('txtNamaMhs', TRUE);
		$tglLhr = $this->input->post('dtTglLahir', TRUE);
		$alamat = $this->input->post('txtAlamat', TRUE);
		
		$this->form_validation->set_rules('txtNim', 'Nim', 'required');
		$this->form_validation->set_rules('txtNamaMhs', 'Nama', 'required');
		$this->form_validation->set_rules('dtTglLahir', 'Tanggal Lahir', 'required');
		$this->form_validation->set_rules('txtAlamat', 'Alamat', 'required');
		
		$this->data['content'] = 'admin/MasterMhs';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingMhs');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$mhs = $this->Admin_Model->get_ten_mhs($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_mhs();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			
			// Set template tabel, untuk efek selang-seling tiap baris
			$tmpl = array( 'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
						  'row_alt_start'  => '<tr class="zebra">',
							'row_alt_end'    => '</tr>'
						  );
			$this->table->set_template($tmpl);

			// Set heading untuk tabel
			$this->table->set_empty("&nbsp;");
			$this->table->set_heading('No','Nim', 'Nama', 'Tgl. Lahir', 'Alamat','Actions');
			
			// Penomoran baris data
			$i = 0 + $offset;
			
			foreach ($mhs as $mahasiswa)
			{
				// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
				$this->table->add_row(++$i, $mahasiswa->NIM, $mahasiswa->NAMA, $mahasiswa->TGLLAHIR, $mahasiswa->ALAMAT,
										anchor('admin/updateMhs/'.$mahasiswa->NIM,'update',array('class' => 'update')).' '.
										anchor('admin/delMhs/'.$mahasiswa->NIM,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"))
									);
			}
			$this->data['tableMhs'] = $this->table->generate();
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				$dataMhs = array("nama" => $nama, "tgllahir" => $tgllahir, "alamat" => $alamat);
				$result = $this->Admin_Model->uppdateMhs($nim, $dataMhs);
				$this->data['error'] = 'Berhasil disimpan';
				redirect('admin/MasterMhs');
			}
			else
			{
				$this->data['error'] = 'Berhasil disimpan';
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterMhs');
			
		}
	}
	
	function doUpdateDosen()
	{
		$this->load->library('form_validation');
		
		$nim  = $this->input->post('txtNim', TRUE);
        $nama = $this->input->post('txtNamaMhs', TRUE);
		
		$this->form_validation->set_rules('txtNim', 'Nim', 'required');
		$this->form_validation->set_rules('txtNamaMhs', 'Nama', 'required');
		
		$this->data['content'] = 'admin/MasterMhs';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingMhs');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$mhs = $this->Admin_Model->get_ten_mhs($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_mhs();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			
			// Set template tabel, untuk efek selang-seling tiap baris
			$tmpl = array( 'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
						  'row_alt_start'  => '<tr class="zebra">',
							'row_alt_end'    => '</tr>'
						  );
			$this->table->set_template($tmpl);

			// Set heading untuk tabel
			$this->table->set_empty("&nbsp;");
			$this->table->set_heading('No','Nim', 'Nama', 'Tgl. Lahir', 'Alamat','Actions');
			
			// Penomoran baris data
			$i = 0 + $offset;
			
			foreach ($mhs as $mahasiswa)
			{
				// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
				$this->table->add_row(++$i, $mahasiswa->NIM, $mahasiswa->NAMA, $mahasiswa->TGLLAHIR, $mahasiswa->ALAMAT,
										anchor('admin/updateMhs/'.$mahasiswa->NIM,'update',array('class' => 'update')).' '.
										anchor('admin/delMhs/'.$mahasiswa->NIM,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"))
									);
			}
			$this->data['tableMhs'] = $this->table->generate();
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				$dataMhs = array("nama" => $nama, "tgllahir" => $tgllahir, "alamat" => $alamat);
				$result = $this->Admin_Model->uppdateMhs($nim, $dataMhs);
				$this->data['error'] = 'Berhasil disimpan';
				redirect('admin/MasterMhs');
			}
			else
			{
				$this->data['error'] = 'Berhasil disimpan';
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterMhs');
			
		}
	}
	
	function updateDosen($nip)
	{
		$this->data['content'] = 'admin/masterDosen';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/doUpdateMhs');
		
		//setting readonly pada field kd Mahasiswa
		$this->data['readonly'] = 'readonly = "true"';
		$this->data['error'] = '';
		//get data Mahasiswa from database
		$dosen = $this->Admin_Model->get_dos_nip($nip)->row();
		$this->data['default']['NIP'] = $dosen->nip;
		$this->data['default']['NamaDosen'] = $dosen->nama_pegawai;
		$this->data['ddlKeahlian'] = $this->setting_m->getCboKeahlianDosen();
		
			$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		$dos = $this->Admin_Model->get_ten_dos($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_dosen();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable= '';
			foreach ($dos as $jur)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NIP.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NAMA_PEGAWAI.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NAMA_KEAHLIAN.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateDosen/'.$jur->NIP,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delDosen/'.$jur->NIP,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableDos'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}	
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	function savingDosen()
	{
		$this->load->library('form_validation');
		
		$nip  = $this->input->post('txtNIP', TRUE);
        $nama = $this->input->post('txtNamaDosen', TRUE);
		$kdKeahlian = $this->input->post('ddlKeahlian', TRUE);
		
		$this->form_validation->set_rules('txtNIP', 'NIP', 'required');
		$this->form_validation->set_rules('txtNamaDosen', 'Nama', 'required');
		
		$this->data['content'] = 'admin/masterDosen';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		$this->data['ddlKeahlian'] = $this->setting_m->getCboPembimbing();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingDosen');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$dos = $this->Admin_Model->get_ten_dos($this->limit)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_dosen();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable= '';
			foreach ($dos as $jur)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NIP.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NAMA.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NAME_KEAHLIAN.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateJurusan/'.$jur->NIP,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delDosen/'.$jur->NIP,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableDos'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				$result = $this->Admin_Model->doSavingDosen($nip, $nama, $kdKeahlian);
				$this->data['error'] = 'Berhasil disimpan';
				redirect('admin/MasterDosen');
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterDosen');
			
		}
	}
	
	function MasterDosen()
	{
		$this->data['content'] = 'admin/masterDosen';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingDosen');
		$this->data['ddlKeahlian'] = $this->setting_m->getCboKeahlianDosen();
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$dos = $this->Admin_Model->get_ten_dos($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_dosen();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterJurusan');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable= '';
			foreach ($dos as $jur)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NIP.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NAMA_PEGAWAI.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->NAMA_KEAHLIAN.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateDosen/'.$jur->NIP,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delDosen/'.$jur->NIP,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableDos'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function delDosen($nip)
	{
		try
		{
			$result = $this->Admin_Model->deleteDosen($nip);
			$this->data['error'] = 'Data Berhasil di Hapus';
			redirect('admin/MasterDosen');
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/MasterDosen');
		}
	}
	function MasterJurusan()
	{
		
		$this->data['content'] = 'admin/masterJurusan';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingJurusan');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		$this->data['cboFakultas'] = $this->setting_m->getCboFakultas();
		$this->table->clear();
		
		
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		$dtTable = '';
		// Load data dari tabel absen
		$jurusans = $this->Admin_Model->get_ten_jurusan();
			foreach ($jurusans as $jur)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->kd_jurusan.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->nama_jurusan.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateJurusan/'.$jur->kd_jurusan,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delJurusan/'.$jur->kd_jurusan,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableJurusan'] = $dtTable;
			$this->data['error'] = '';
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	function MasterTipeKoleksi($offset = 0)
	{
		$this->data['content'] = 'admin/mastertipekoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingTipeKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
	
		
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipeKoleksi = $this->Admin_Model->get_ten_jenis_koleksi($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_rows_jurusan();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterTipeKoleksi');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($tipeKoleksi as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_type_koleksi.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_type.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateTipeKoleksi/'.$type->kd_type_koleksi,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delTipeKoleksi/'.$type->kd_type_koleksi,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableTipeKoleksi'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function updateTipeKoleksi($kdtipe, $offset = 0)
	{
		$this->data['content'] = 'admin/mastertipekoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/doUpdateTipeKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = 'readonly = "true"';
		
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipeKoleksi = $this->Admin_Model->get_ten_jenis_koleksi($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_rows_jurusan();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterTipeKoleksi');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($tipeKoleksi as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_type_koleksi.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_type.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateTipeKoleksi/'.$type->kd_type_koleksi,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delTipeKoleksi/'.$type->kd_type_koleksi,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableTipeKoleksi'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//get data Jurusan from database
		$jurusan = $this->Admin_Model->get_tipe_by_kd($kdtipe)->row();
		$this->data['default']['kd_type_koleksi'] = $jurusan->kd_type_koleksi;
		$this->data['default']['nama_type'] = $jurusan->nama_type;
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function delMhs($nim)
	{
		try
		{
			$result = $this->Admin_Model->deleteMhs($nim);
			$this->data['error'] = '';
			redirect('admin/MasterMhs');
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/MasterMhs');
		}
	}
	
	function delTipeKoleksi($kdTipe)
	{
		try
		{
			$result = $this->Admin_Model->deleteTipeKoleksi($kdTipe);
			$this->data['error'] = '';
			redirect('admin/MasterTipeKoleksi');
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/MasterTipeKoleksi');
		}
		
	}
	
	function doUpdateTipeKoleksi()
	{
		$this->load->library('form_validation');
		
		$KdTipe       = $this->input->post('txtkdType', TRUE);
        $NameTipe   = $this->input->post('txtNamatype', TRUE);
		
		$this->form_validation->set_rules('txtkdType', 'Kode Tipe', 'required');
		$this->form_validation->set_rules('txtNamatype', 'Nama Tipe', 'required');
		
		$this->data['content'] = 'admin/mastertipekoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingTipeKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		
		
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipe = $this->Admin_Model->get_ten_jenis_koleksi($this->limit,0)->result();
		$num_rows = $this->Admin_Model->count_all_num_rows_jurusan();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterTipeKoleksi');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			
			// Set template tabel, untuk efek selang-seling tiap baris
			$tmpl = array( 'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
						  'row_alt_start'  => '<tr class="zebra">',
							'row_alt_end'    => '</tr>'
						  );
			$this->table->set_template($tmpl);

			// Set heading untuk tabel
			$this->table->set_empty("&nbsp;");
			$this->table->set_heading('No','Kode Tipe', 'Nama Tipe', 'Actions');
			
			// Penomoran baris data
			$i = 0 + $offset;
			
			foreach ($tipe as $type)
			{
				// Penyusunan data baris per baris, perhatikan pembuatan link untuk updat dan delete
				$this->table->add_row(++$i, $type->kd_type_koleksi, $type->nama_type, 
										anchor('admin/updateTipeKoleksi/'.$type->kd_type_koleksi,'update',array('class' => 'update')).' '.
										anchor('admin/delTipeKoleksi/'.$type->kd_type_koleksi,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"))
									);
			}
			$this->data['tableTipeKoleksi'] = $this->table->generate();
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				$result = $this->Admin_Model->updateTipeKoleksi($KdTipe, $NameTipe);
				$this->data['error'] = 'Berhasil disimpan';
				redirect('admin/mastertipekoleksi');
			}
			else
			{
				$this->data['error'] = 'Berhasil disimpan';
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/mastertipekoleksi');
			
		}
	}
	
	function savingJurusan()
	{
		$this->load->library('form_validation');
		
		$KdJurusan       = $this->input->post('txtKodeJurusan', TRUE);
        $NameJurusan   = $this->input->post('txtNamaJurusan', TRUE);
		$kdFakultas   = $this->input->post('ddlFakultas', TRUE);
		
		$this->form_validation->set_rules('txtKodeJurusan', 'Kode Jurusan', 'required');
		$this->form_validation->set_rules('txtNamaJurusan', 'Nama Jurusan', 'required');
		
		$this->data['content'] = 'admin/masterJurusan';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingJurusan');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		//$this->data['tableJurusan'] = $this->getTableTenJurusan();
		$this->data['error'] = '';
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->doSavingJurusan($KdJurusan, $NameJurusan, $kdFakultas) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					redirect('admin/masterjurusan');
				}
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/masterjurusan');
			
		}
	}
	
	function savingSubKoleksi()
	{
		$this->load->library('form_validation');
		
		$kdSub       = $this->input->post('txtKdSub', TRUE);
        $namaSub   = $this->input->post('txtNamaSubKoleksi', TRUE);
		
		$this->form_validation->set_rules('txtKdSub', 'Kode Sub Koleksi', 'required');
		$this->form_validation->set_rules('txtNamaSubKoleksi', 'Nama Sub Koleksi', 'required');
		
		$this->data['content'] = 'admin/MasterSubKoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingSubKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		//$this->data['tableJurusan'] = $this->getTableTenJurusan();
		$this->data['error'] = '';
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->doSavingSubKoleksi($kdSub, $namaSub) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					redirect('admin/MasterSubKoleksi');
				}
			}
			else
			{
				$this->load->view('home/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterSubKoleksi');
			
		}
	}
	
	function updateJurusan($kdJurusan)
	{
		$this->data['content'] = 'admin/masterJurusan';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		$this->data['cboFakultas'] = $this->setting_m->getCboFakultas();
		//setting form action
		$this->data['form_action'] = site_url('admin/do_update');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = 'readonly = "true"';
		$dtTable = '';
		// Load data dari tabel absen
		$jurusans = $this->Admin_Model->get_ten_jurusan();
			foreach ($jurusans as $jur)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->kd_jurusan.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$jur->nama_jurusan.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateJurusan/'.$jur->kd_jurusan,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delJurusan/'.$jur->kd_jurusan,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableJurusan'] = $dtTable;
			$this->data['error'] = '';
		
		
		//get data Jurusan from database
		$jurusan = $this->Admin_Model->get_jurusan_by_kd($kdJurusan)->row();
		$this->data['default']['kd_jurusan'] = $jurusan->kd_jurusan;
		$this->data['default']['name_jurusan'] = $jurusan->nama_jurusan;
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	function do_update()
	{
		$this->load->library('form_validation');
		
		$KdJurusan       = $this->input->post('txtKodeJurusan', TRUE);
        $NameJurusan   = $this->input->post('txtNamaJurusan', TRUE);
		
		$this->form_validation->set_rules('txtKodeJurusan', 'Kode Jurusan', 'required');
		$this->form_validation->set_rules('txtNamaJurusan', 'Nama Jurusan', 'required');
		
		$this->data['content'] = 'admin/masterJurusan';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingJurusan');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		$this->data['error'] = '';
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->updateJurusan($KdJurusan, $NameJurusan) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					redirect('admin/masterjurusan');
				}
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/masterjurusan');
			
		}
	}
	
	function updateSubTipeKoleksi($kdtipe, $offset = 0)
	{
		$this->data['content'] = 'admin/MasterSubTipeKoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/doUpdateTipeKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = 'readonly = "true"';
		
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipeKoleksi = $this->Admin_Model->get_ten_sub_jenis_koleksi($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_rows_subKoleksi();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterSubTipeKoleksi');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($tipeKoleksi as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_sub_tipe_koleksi.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_sub_koleksi.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateSubTipeKoleksi/'.$type->kd_sub_tipe_koleksi,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delSubTipeKoleksi/'.$type->kd_sub_tipe_koleksi,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableTipeKoleksi'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//get data Jurusan from database
		$jurusan = $this->Admin_Model->get_Subtipe_by_kd($kdtipe)->row();
		$this->data['default']['KDSUB'] = $jurusan->kd_sub_tipe_koleksi;
		$this->data['default']['namaSubKoleksi'] = $jurusan->nama_sub_koleksi;
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function delSubTipeKoleksi($kdSub)
	{
			try
		{
			if ( $result = $this->Admin_Model->deleteJenisSubKoleksi($kdSub) == true)
			{
				$this->data['error'] = '';
				redirect('admin/MasterSubKoleksi');
			}
			
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/MasterSubKoleksi');
		}
		
	}
	
	function MasterSubKoleksi($offset = 0)
	{
		$this->data['content'] = 'admin/MasterSubTipeKoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingSubKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipeKoleksi = $this->Admin_Model->get_ten_sub_jenis_koleksi($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_rows_subKoleksi();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/MasterSubKoleksi');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($tipeKoleksi as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_sub_tipe_koleksi.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_sub_koleksi.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateSubTipeKoleksi/'.$type->kd_sub_tipe_koleksi,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delSubTipeKoleksi/'.$type->kd_sub_tipe_koleksi,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableTipeKoleksi'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function MasterKeahlian($offset = 0)
	{
		$this->data['content'] = 'admin/masterKeahliah';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingKeahlian');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipeKoleksi = $this->Admin_Model->get_ten_keahlian($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_Keahlian();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/masterKeahlian');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($tipeKoleksi as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_keahlian.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_keahlian.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateKeahlian/'.$type->kd_keahlian,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delKeahlian/'.$type->kd_keahlian,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableKeahlian'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function savingKeahlian()
	{
		$this->load->library('form_validation');
		
		$kd       = $this->input->post('txtKdKeahlian', TRUE);
        $nama  = $this->input->post('txtNamaKeahlian', TRUE);
		
		$this->form_validation->set_rules('txtKdKeahlian', 'Kode Keahlian', 'required');
		$this->form_validation->set_rules('txtNamaKeahlian', 'Nama Keahlian', 'required');
		
		$this->data['content'] = 'admin/MasterKeahlian';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingKeahlian');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		
		$this->table->clear();
		//$this->data['tableJurusan'] = $this->getTableTenJurusan();
		$this->data['error'] = '';
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->doSavingKeahlian($kd, $nama) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					redirect('admin/MasterKeahlian');
				}
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterKeahlian');
			
		}
	}
	
	function updateKeahlian($kd)
	{
		$this->data['content'] = 'admin/MasterKeahliah';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		//setting form action
		$this->data['form_action'] = site_url('admin/do_update_keahlian');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = 'readonly = "true"';
		$dtTable = '';
		// Load data dari tabel absen
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$tipeKoleksi = $this->Admin_Model->get_ten_keahlian($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_Keahlian();
		
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/masterKeahlian');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($tipeKoleksi as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_keahlian.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_keahlian.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateKeahlian/'.$type->kd_keahlian,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delSubTipeKoleksi/'.$type->kd_keahlian,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableKeahlian'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}	
		
		//get data Keahlian from database
		$keahlian = $this->Admin_Model->get_keahlian_by_kd($kd)->row();
		$this->data['default']['KDKEAHLIAN'] = $keahlian->kd_keahlian;
		$this->data['default']['NAMAKEAHLIAN'] = $keahlian->nama_keahlian;
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function do_update_keahlian()
	{
		$this->load->library('form_validation');
		
		$kd       = $this->input->post('txtKdKeahlian', TRUE);
        $nama   = $this->input->post('txtNamaKeahlian', TRUE);
		
		$this->form_validation->set_rules('txtKdKeahlian', 'Kode Keahlian', 'required');
		$this->form_validation->set_rules('txtNamaKeahlian', 'Nama Keahlian', 'required');
			
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->updateKeahlian($kd, $nama) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					redirect('admin/MasterKeahlian');
				}
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterKeahlian');
			
		}
	}
	
	function savingTipeKoleksi()
	{
		
		$KdType       = $this->input->post('txtkdType', TRUE);
        $NamaTypeKoleksi   = $this->input->post('txtNamatype', TRUE);
		
		$this->load->library('form_validation');
		
		$this->form_validation->set_rules('txtkdType', 'Kode Type', 'required');
		$this->form_validation->set_rules('txtNamatype', 'Nama Type', 'required');
		
		$this->data['content'] = 'admin/mastertipekoleksi';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		
		//setting form action
		$this->data['form_action'] = site_url('admin/savingTipeKoleksi');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
	
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->doSavingTipeKoleksi($KdType, $NamaTypeKoleksi) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					
					// Load data dari tabel absen
			$tipeKoleksi = $this->Admin_Model->get_ten_jenis_koleksi($this->limit, $offset)->result();
			$num_rows = $this->Admin_Model->count_all_num_row_tipe();
			
			if ($num_rows > 0) // Jika query menghasilkan data
			{
				// Membuat pagination			
				$config['base_url'] = site_url('admin/MasterTipeKoleksi');
				$config['total_rows'] = $num_rows;
				$config['per_page'] = $this->limit;
				$config['uri_segment'] = $uri_segment;
				$this->pagination->initialize($config);
				$this->data['pagination'] = $this->pagination->create_links();
				$dtTable  = '';
				foreach ($tipeKoleksi as $type)
				{
					$dtTable .= '<tr>';
					$dtTable .= '<td headers="t4" class="standard">'.$type->kd_type_koleksi.'</td>';
					$dtTable .= '<td headers="t4" class="standard">'.$type->nama_type.'</td>
								<td class="standard" align="center">';
					$dtTable .= anchor('admin/updateTipeKoleksi/'.$type->kd_type_koleksi,'update',array('class' => 'update'));
					$dtTable .= ' ';
					$dtTable .= anchor('admin/delTipeKoleksi/'.$type->kd_type_koleksi,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
					$dtTable.='</td></tr>';
				}
				$this->data['tableTipeKoleksi'] = $dtTable;
				$this->data['error'] = '';
			}
			else
			{
				$this->data['error'] = 'Tidak ditemukan satupun data master!';
			}	
					
					$this->load->view('home/index', $this->data);
				}
			}
			else
			{
				$this->load->view('home/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			$this->load->view('admin/index', $this->data);
			
		}
	}
	function delJurusan($kdJur)
	{
			try
		{
			if ( $result = $this->Admin_Model->deleteJurusan($kdJur) == true)
			{
				$this->data['error'] = '';
				redirect('admin/masterjurusan');
			}
			
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/masterjurusan');
		}
		
	}
	
	function delKeahlian($kd)
	{
			try
		{
			if ( $result = $this->Admin_Model->deleteKeahlian($kd) == true)
			{
				$this->data['error'] = '';
				redirect('admin/MasterKeahlian');
			}
			
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/MasterKeahlian');
		}
		
	}
	
	function appvUser($kdUser)
	{
		try
		{
			if ( $this->Admin_Model->update($kdUser) == true){
				redirect('admin');
			}
			else
			{
				redirect('admin');
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			$this->load->view('dosen/insert', $this->data);
		}
	}
	function Publish($id)
	{
		try
		{
			$this->Admin_Model->appPublish($id);
			redirect('admin');
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			$this->load->view('admin', $this->data);
		}
	}
	function appvAdvisor($id)
	{
		try
		{
			$this->Admin_Model->appApprove($id); 
			redirect('admin');
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			$this->load->view('admin', $this->data);
		}
	}
	
	function masterGelar()
	{
		$this->data['content'] = 'admin/masterGelar';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		//setting form action
		$this->data['form_action'] = site_url('admin/savingGelar');
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		// Offset
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		// Load data dari tabel absen
		$geLar = $this->Admin_Model->get_ten_gelar($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_gelar();
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/masterKeahlian');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($geLar as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_gelar.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_gelar.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateGelar/'.$type->kd_gelar,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin/delGelar/'.$type->kd_gelar,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableGelar'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function savingGelar()
	{
		$kd = $this->input->post('txtKdGelar', TRUE);
        $nama = $this->input->post('txtNamaGelar', TRUE);
		$this->load->library('form_validation');
		$this->form_validation->set_rules('txtKdGelar', 'Kode Gelar', 'required');
		$this->form_validation->set_rules('txtNamaGelar', 'Nama Gelar', 'required');
		$this->data['content'] = 'admin/masterGelar';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		//setting form action
		$this->data['form_action'] = site_url('admin/savingGelar');
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = '';
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->doSavingGelar($kd, $nama) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';	
					redirect('admin/masterGelar');
				}
			}
			else
			{
				redirect('admin/masterGelar');
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/masterGelar');
			
		}
	}
	
	function updateGelar($kd)
	{
		$this->data['content'] = 'admin/masterGelar';
		$this->data['left'] = 'bg_left';
		$this->data['footer'] = 'footer';
		$this->data['account'] = $this->setting_m->getUploadFromTypeCollection();
		//setting form action
		$this->data['form_action'] = site_url('admin/do_update_Gelar');
		
		//setting readonly pada field kd jurusan
		$this->data['readonly'] = 'readonly = "true"';
		$dtTable = '';
		// Load data dari tabel absen
		$uri_segment = 3;
		$offset = $this->uri->segment($uri_segment);
		
		// Load data dari tabel absen
		$geLar = $this->Admin_Model->get_ten_gelar($this->limit, $offset)->result();
		$num_rows = $this->Admin_Model->count_all_num_row_gelar();
		if ($num_rows > 0) // Jika query menghasilkan data
		{
			// Membuat pagination			
			$config['base_url'] = site_url('admin/masterKeahlian');
			$config['total_rows'] = $num_rows;
			$config['per_page'] = $this->limit;
			$config['uri_segment'] = $uri_segment;
			$this->pagination->initialize($config);
			$this->data['pagination'] = $this->pagination->create_links();
			$dtTable  = '';
			foreach ($geLar as $type)
			{
				$dtTable .= '<tr>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->kd_gelar.'</td>';
				$dtTable .= '<td headers="t4" class="standard">'.$type->nama_gelar.'</td>
							<td class="standard" align="center">';
				$dtTable .= anchor('admin/updateGelar/'.$type->kd_gelar,'update',array('class' => 'update'));
				$dtTable .= ' ';
				$dtTable .= anchor('admin//'.$type->kd_gelar,'hapus',array('class'=> 'delete','onclick'=>"return confirm('Anda yakin akan menghapus data ini?')"));
				$dtTable.='</td></tr>';
			}
			$this->data['tableGelar'] = $dtTable;
			$this->data['error'] = '';
		}
		else
		{
			$this->data['error'] = 'Tidak ditemukan satupun data master!';
		}		
		
		//get data Gelar from database
		$gelar = $this->Admin_Model->get_gelar_by_kd($kd)->row();
		$this->data['default']['kdGelar'] = $gelar->kd_gelar;
		$this->data['default']['namaGelar'] = $gelar->nama_gelar;
		
		//Memanggil View
		$this->load->view('home/index', $this->data);
	}
	
	function do_update_Gelar()
	{
		$this->load->library('form_validation');
		
		$kd       = $this->input->post('txtKdGelar', TRUE);
        $nama   = $this->input->post('txtNamaGelar', TRUE);
		
		$this->form_validation->set_rules('txtKdGelar', 'Kode Gelar', 'required');
		$this->form_validation->set_rules('txtNamaGelar', 'Nama Gelar', 'required');
			
		try
		{
			if ($this->form_validation->run() == TRUE)
			{
				if ( $result = $this->Admin_Model->doUpdateGelar($kd, $nama) == true)
				{
					$this->data['error'] = 'Berhasil disimpan';
					redirect('admin/masterGelar');
				}
			}
			else
			{
				$this->load->view('admin/index', $this->data);
			}
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal disimpan';
			redirect('admin/MasterKeahlian');
			
		}
	}
	function delGelar($kd)
	{
		try
		{
			if ( $result = $this->Admin_Model->dodeleteGelar($kd) == true)
			{
				$this->data['error'] = '';
				redirect('admin/masterGelar');
			}
			
		}
		catch (Exception $e)   // You throwed your custom exception with the failed validation information
		{
			// Do something with your custom exception like the kohana example
			//Memanggil View
			$this->data['error'] = 'Gagal delete';
			redirect('admin/masterGelar');
		}
		
	}
	
	function creategraph()
	{
		$this->load->library('graph');
		$data_1 = array('30','20');
		// for( $i=0; $i<7; $i++ )
		// {
			// $data_1[] = rand(30,0);
		// }
		$ff = new graph();
		$ff->set_data( $data_1 );
		$ff->title( 'Trafik Jumlah Koleksi', '{font-size: 14px; color: #3D5570;font-family:calibri;}' );
		$ff->line_dot( 3, 5, '#8B6122', 'Repository', 10 );
		$ff->bg_colour = '#FFFFFF';
		$ff->x_axis_colour( '#818D9D', '#ADB5C7' );
		$ff->y_axis_colour( '#818D9D', '#ADB5C7' );
		$ff->set_x_labels( array( '2013') );
		$ff->set_y_max( 600 );
		$ff->y_label_steps( 10 );
		$ff->set_y_legend( 'Jumlah Koleksi', 12, '#3D5570' );
		$ff->set_x_legend( 'Tahun', 12, '#3D5570' );
		$ff->set_output_type('js');
		$ff->width = '20%';
		$ff->height = '20%';
		return $ff->render();
	}
	
}